<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="../../HTMLTurbo.css">
<link rel="stylesheet" type="text/css" href="../style/demo.css">

<script charset="utf-8" src="../../jquery/1.12.4/jquery.min.js"></script>
<script charset="utf-8" src="../../HTMLTurbo.php"></script>
<style>
body,html{
	padding: 0;
}
body{
	padding-bottom: 18px;
	padding-top: 18px;
}
#headTable{
	position: fixed;
	left: 0;
	top: 0;
}
#bodyTable{
	position:relative;
	left: 0;
	top: 0;
}
#footerTable{
	position: fixed;
	left: 0;
	bottom: 0;
}
</style>
</head>

<body>
<div class="ht">
	<table border="1" cellpadding="0" cellspacing="0" id="headTable">
		<tr>
	    	<td>1</td>
	        <td>2</td>
	        <td>3</td>
	    </tr>
	</table>
	<table border="1" cellpadding="0" cellspacing="0" id="bodyTable">
		<thead>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    </thead>
	    <tbody>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    <tr>
	    	<td>1</td>
	        <td width="100">2</td>
	        <td>3</td>
	    </tr>
	    </tbody>
	    <tfoot>
		<tr>
	    	<td>1</td>
	        <td>2</td>
	        <td>3</td>
	    </tr>
	    </tfoot>
	</table>
	<table border="1" cellpadding="0" cellspacing="0" id="footerTable">
		<tr>
	    	<td>1</td>
	        <td>2</td>
	        <td>3</td>
	    </tr>
	</table>
</div>
<script>
cloneTableWidth("#bodyTable","#headTable");
cloneTableWidth("#bodyTable","#footerTable");

function cloneTableWidth(sourceTable,table){
	$("tr",sourceTable).eq(0).find("td").each(function(index, element) {
		var width=$(element).width();
		$("tr",table).eq(0).find("td").eq(index).width(width);
    });
}
</script>
</body>
</html>